﻿namespace Bootstrap5;
using System.Drawing;
using System;

using Design;

#region Margin
/// <summary>
/// 外边距 margin。
/// </summary>
public static class Margin
{
    /// <summary>
    /// 表示空间的值是 1。
    /// </summary>
    public static ISpacingDecorator Is1 => new MarginProvider().Is1;
    /// <summary>
    /// 表示空间的值是 2。
    /// </summary>
    public static ISpacingDecorator Is2 => new MarginProvider().Is2;
    /// <summary>
    /// 表示空间的值是 3。
    /// </summary>
    public static ISpacingDecorator Is3 => new MarginProvider().Is3;
    /// <summary>
    /// 表示空间的值是 4。
    /// </summary>
    public static ISpacingDecorator Is4 => new MarginProvider().Is4;
    /// <summary>
    /// 表示空间的值是 5。
    /// </summary>
    public static ISpacingDecorator Is5 => new MarginProvider().Is5;
    /// <summary>
    /// 表示空间的值是 auto。
    /// </summary>
    public static ISpacingDecorator IsAuto => new MarginProvider().IsAuto;
}
#endregion

#region Padding
/// <summary>
/// 内边距 padding。
/// </summary>
public static class Padding
{
    /// <summary>
    /// 表示空间的值是 1。
    /// </summary>
    public static ISpacingDecorator Is1 => new PaddingProvider().Is1;
    /// <summary>
    /// 表示空间的值是 2。
    /// </summary>
    public static ISpacingDecorator Is2 => new PaddingProvider().Is2;
    /// <summary>
    /// 表示空间的值是 3。
    /// </summary>
    public static ISpacingDecorator Is3 => new PaddingProvider().Is3;
    /// <summary>
    /// 表示空间的值是 4。
    /// </summary>
    public static ISpacingDecorator Is4 => new PaddingProvider().Is4;
    /// <summary>
    /// 表示空间的值是 5。
    /// </summary>
    public static ISpacingDecorator Is5 => new PaddingProvider().Is5;
    /// <summary>
    /// 表示空间的值是 auto。
    /// </summary>
    public static ISpacingDecorator IsAuto => new PaddingProvider().IsAuto;
}
#endregion

#region Gutter
/// <summary>
/// 元素之间的间隙。
/// </summary>
public static class Gutter
{
    /// <sendregionummary>
    /// 表示空间的值是 1。
    /// </summary>
    public static IGutterDecorator Is0 => new GutterProvider().Is0;
    /// <sendregionummary>
    /// 表示空间的值是 1。
    /// </summary>
    public static IGutterDecorator Is1 => new GutterProvider().Is1;
    /// <summary>
    /// 表示空间的值是 2。
    /// </summary>
    public static IGutterDecorator Is2 => new GutterProvider().Is2;
    /// <summary>
    /// 表示空间的值是 3。
    /// </summary>
    public static IGutterDecorator Is3 => new GutterProvider().Is3;
    /// <summary>
    /// 表示空间的值是 4。
    /// </summary>
    public static IGutterDecorator Is4 => new GutterProvider().Is4;
    /// <summary>
    /// 表示空间的值是 5。
    /// </summary>
    public static IGutterDecorator Is5 => new GutterProvider().Is5;
}
#endregion

#region RowCols
/// <summary>
/// 栅格中行的固定列数。
/// </summary>
public static class RowCols
{
    /// <summary>
    /// 表示该行的固定列数是 1。
    /// </summary>
    public static IGridDecorator Is1 => new GridRowDecoratorProvider().Is1;
    /// <summary>
    /// 表示该行的固定列数是 2。
    /// </summary>
    public static IGridDecorator Is2 => new GridRowDecoratorProvider().Is2;
    /// <summary>
    /// 表示该行的固定列数是 3。
    /// </summary>
    public static IGridDecorator Is3 => new GridRowDecoratorProvider().Is3;
    /// <summary>
    /// 表示该行的固定列数是 4。
    /// </summary>
    public static IGridDecorator Is4 => new GridRowDecoratorProvider().Is4;
    /// <summary>
    /// 表示该行的固定列数是 5。
    /// </summary>
    public static IGridDecorator Is5 => new GridRowDecoratorProvider().Is5;
    /// <summary>
    /// 表示该行的固定列数是 6。
    /// </summary>
    public static IGridDecorator Is6 => new GridRowDecoratorProvider().Is6;
    /// <summary>
    /// 表示该行的固定列数是 auto。
    /// </summary>
    public static IGridDecorator IsAuto => new GridRowDecoratorProvider().IsAuto;
}
#endregion

#region Col
/// <summary>
/// 栅格中列的占比。
/// </summary>
public static class Col
{
    /// <summary>
    /// 表示该列在这一行的占比值是 1。
    /// </summary>
    public static IGridDecorator Is1 => new GridColumnDecoratorProvider().Is1;
    /// <summary>
    /// 表示该列在这一行的占比值是 2。
    /// </summary>
    public static IGridDecorator Is2 => new GridColumnDecoratorProvider().Is2;
    /// <summary>
    /// 表示该列在这一行的占比值是 3。
    /// </summary>
    public static IGridDecorator Is3 => new GridColumnDecoratorProvider().Is3;
    /// <summary>
    /// 表示该列在这一行的占比值是 4。
    /// </summary>
    public static IGridDecorator Is4 => new GridColumnDecoratorProvider().Is4;
    /// <summary>
    /// 表示该列在这一行的占比值是 5。
    /// </summary>
    public static IGridDecorator Is5 => new GridColumnDecoratorProvider().Is5;
    /// <summary>
    /// 表示该列在这一行的占比值是 6。
    /// </summary>
    public static IGridDecorator Is6 => new GridColumnDecoratorProvider().Is6;

    /// <summary>
    /// 表示该列在这一行的占比值是 6。
    /// </summary>
    public static IGridDecorator Is7 => new GridColumnDecoratorProvider().Is7;

    /// <summary>
    /// 表示该列在这一行的占比值是 6。
    /// </summary>
    public static IGridDecorator Is8 => new GridColumnDecoratorProvider().Is8;
    /// <summary>
    /// 表示该列在这一行的占比值是 6。
    /// </summary>
    public static IGridDecorator Is9 => new GridColumnDecoratorProvider().Is9;
    /// <summary>
    /// 表示该列在这一行的占比值是 6。
    /// </summary>
    public static IGridDecorator Is10 => new GridColumnDecoratorProvider().Is10;
    /// <summary>
    /// 表示该列在这一行的占比值是 6。
    /// </summary>
    public static IGridDecorator Is11 => new GridColumnDecoratorProvider().Is11;
    /// <summary>
    /// 表示该列在这一行的占比值是 6。
    /// </summary>
    public static IGridDecorator Is12 => new GridColumnDecoratorProvider().Is12;
    /// <summary>
    /// 表示该列在这一行的占比值是 auto。
    /// </summary>
    public static IGridDecorator IsAuto => new GridColumnDecoratorProvider().IsAuto;
}
#endregion

#region Offset
/// <summary>
/// 栅格中列的偏移列占比。
/// </summary>
public static class Offset
{
    /// <summary>
    /// 表示该列在这一行的偏移列占比是 1。
    /// </summary>
    public static IGridDecorator Is1 => new GridColumnOffsetDecoratorProvider().Is1;
    /// <summary>
    /// 表示该列在这一行的偏移列占比是 2。
    /// </summary>
    public static IGridDecorator Is2 => new GridColumnOffsetDecoratorProvider().Is2;
    /// <summary>
    /// 表示该列在这一行的偏移列占比是 3。
    /// </summary>
    public static IGridDecorator Is3 => new GridColumnOffsetDecoratorProvider().Is3;
    /// <summary>
    /// 表示该列在这一行的偏移列占比是 4。
    /// </summary>
    public static IGridDecorator Is4 => new GridColumnOffsetDecoratorProvider().Is4;
    /// <summary>
    /// 表示该列在这一行的偏移列占比是 5。
    /// </summary>
    public static IGridDecorator Is5 => new GridColumnOffsetDecoratorProvider().Is5;
    /// <summary>
    /// 表示该列在这一行的偏移列占比是 6。
    /// </summary>
    public static IGridDecorator Is6 => new GridColumnOffsetDecoratorProvider().Is6;
    /// <summary>
    /// 表示该列在这一行的偏移列占比是 7。
    /// </summary>
    public static IGridDecorator Is7 => new GridColumnOffsetDecoratorProvider().Is7;
    /// <summary>
    /// 表示该列在这一行的偏移列占比是 8。
    /// </summary>
    public static IGridDecorator Is8 => new GridColumnOffsetDecoratorProvider().Is8;
    /// <summary>
    /// 表示该列在这一行的偏移列占比是 9。
    /// </summary>
    public static IGridDecorator Is9 => new GridColumnOffsetDecoratorProvider().Is9;
    /// <summary>
    /// 表示该列在这一行的偏移列占比是 10。
    /// </summary>
    public static IGridDecorator Is10 => new GridColumnOffsetDecoratorProvider().Is10;
    /// <summary>
    /// 表示该列在这一行的偏移列占比是 11。
    /// </summary>
    public static IGridDecorator Is11 => new GridColumnOffsetDecoratorProvider().Is11;
    /// <summary>
    /// 表示该列在这一行的偏移列占比是 12。
    /// </summary>
    public static IGridDecorator Is12 => new GridColumnOffsetDecoratorProvider().Is12;
}
#endregion

#region Display
/// <summary>
/// 显示方式。
/// </summary>
public static class Display
{
    public static IDisplayDecorator None => new DisplayDecoratorProvider().None;
    public static IDisplayDecorator Block => new DisplayDecoratorProvider().Block;
    public static IDisplayDecorator Inline => new DisplayDecoratorProvider().Inline;
    public static IDisplayDecorator InlineBlock => new DisplayDecoratorProvider().InlineBlock;
    public static IDisplayDecorator Grid => new DisplayDecoratorProvider().Grid;
    public static IDisplayDecorator Table => new DisplayDecoratorProvider().Table;
    public static IDisplayDecorator TableRow => new DisplayDecoratorProvider().TableRow;
    public static IDisplayDecorator TableCell => new DisplayDecoratorProvider().TableCell;
    public static IDisplayDecorator Flex => new DisplayDecoratorProvider().Flex;
    public static IDisplayDecorator InlineFlex => new DisplayDecoratorProvider().InlineFlex;
}
#endregion

#region Css
/// <summary>
/// Represents the css class utilities of Bootstrap.
/// </summary>
public static class Css
{
    /// <summary>
    /// Gets the class of utilties.
    /// </summary>
    public static ICssUtilityDecorator Class => new CssUtilityDecoratorProvider();

    /// <summary>
    /// Set the display of element to be flex.
    /// </summary>
    /// <param name="inline">If <c>true</c>, use 'inline-flex'; otherwise <c>false</c>.</param>
    /// <returns>The instance of <see cref="ICssUtilityDecorator"/> class.</returns>
    public static ICssUtilityDecorator Flex(bool inline = false) 
        => inline ? Display(DisplayType.InlineFlex) : Display(DisplayType.Flex);

    /// <summary>
    /// Set the text style of element.
    /// </summary>
    /// <param name="text">The text style.</param>
    /// <returns>The instance of <see cref="ICssUtilityDecorator"/> class.</returns>
    public static ICssUtilityDecorator Text(Text text) => new CssUtilityDecoratorProvider().Text(text);
    /// <summary>
    /// Set the margin between elements.
    /// </summary>
    /// <param name="num">The size of space.</param>
    /// <param name="side">The side of space.</param>
    /// <param name="breakPoint">Responsive to support.</param>
    /// <returns>The instance of <see cref="ICssUtilityDecorator"/> class.</returns>
    public static ICssUtilityDecorator Margin(SpaceNum num, SpaceSide? side = default, BreakPoint? breakPoint = default)
        => new CssUtilityDecoratorProvider().Margin(num, side, breakPoint);

    /// <summary>
    /// Set the padding between elements.
    /// </summary>
    /// <param name="num">The size of space.</param>
    /// <param name="side">The side of space.</param>
    /// <param name="breakPoint">Responsive to support.</param>
    /// <returns>The instance of <see cref="ICssUtilityDecorator"/> class.</returns>
    public static ICssUtilityDecorator Padding(SpaceNum num, SpaceSide? side = default, BreakPoint? breakPoint = default)
        => new CssUtilityDecoratorProvider().Padding(num, side, breakPoint);

    /// <summary>
    /// Set the gutter between elements.
    /// </summary>
    /// <param name="num">The size of space.</param>
    /// <param name="side">The side of space.</param>
    /// <param name="breakPoint">Responsive to support.</param>
    /// <returns>The instance of <see cref="ICssUtilityDecorator"/> class.</returns>
    public static ICssUtilityDecorator Gutter(Num num, Side? side = default, BreakPoint? breakPoint = default)
        => new CssUtilityDecoratorProvider().Gutter(num, side, breakPoint);

    /// <summary>
    /// Set the float style of element.
    /// </summary>
    /// <param name="float">Float type.</param>
    /// <param name="breakPoint">Responsive to support.</param>
    /// <returns>The instance of <see cref="ICssUtilityDecorator"/> class.</returns>
    public static ICssUtilityDecorator Float(Float @float, BreakPoint? breakPoint) => new CssUtilityDecoratorProvider().Float(@float, breakPoint);
    /// <summary>
    /// Set the display style of element.
    /// </summary>
    /// <param name="display">Display type.</param>
    /// <param name="breakPoint">Responsive to support.</param>
    /// <param name="print">If <c>true</c> to only support in print page; otherwise <c>false</c>.</param>
    /// <returns>The instance of <see cref="ICssUtilityDecorator"/> class.</returns>
    public static ICssUtilityDecorator Display(DisplayType display, BreakPoint? breakPoint = default, bool print = default) => new CssUtilityDecoratorProvider().Display(display, breakPoint, print);
    /// <summary>
    /// Set the background color of element.
    /// </summary>
    /// <param name="color">The background color.</param>
    /// <param name="gradient">If <c>true</c> to support gradient background; otherwise <c>false</c>.</param>
    /// <returns>The instance of <see cref="ICssUtilityDecorator"/> class.</returns>
    public static ICssUtilityDecorator BgColor(BgColor color, bool gradient = false) => new CssUtilityDecoratorProvider().BgColor(color,gradient);
    /// <summary>
    /// Set the text color of element.
    /// </summary>
    /// <param name="color">The text color.</param>
    /// <returns>The instance of <see cref="ICssUtilityDecorator"/> class.</returns>
    public static ICssUtilityDecorator TextColor(TextColor color) => new CssUtilityDecoratorProvider().TextColor(color);

    /// <summary>
    /// Set the dropdown direction for parent element of dropdown menu.
    /// </summary>
    /// <param name="direction">The direction of dropdown.</param>
    /// <returns>The instance of <see cref="ICssUtilityDecorator"/> class.</returns>
    public static ICssUtilityDecorator DropDownPlacement(DropDownDirection? direction) => new CssUtilityDecoratorProvider().SetClass($"drop{direction?.GetEnumCssClass()}");
}
#endregion
